﻿#ifndef SPLASHSCREEN_H
#define SPLASHSCREEN_H

#include <windows.h>
#include <windowsx.h>
#include <gdiplus.h>
#pragma comment(lib, "gdiplus.lib")

class SplashScreen {
public:
  SplashScreen();
  ~SplashScreen();

  void InitializeGdiPlus();
  void ShutdownGdiPlus();
  void Release();
  void LoadPicture(HWND hWnd, const wchar_t* imagePath);
  void DrawSplashScreen(HWND hWnd);
  void DoPaint(HWND hWnd);
  void DrawProgressBar();
  void SetProgress(float value) { progress_ = value; }

  RECT progress_rect;

private:
  // 用于GDI+初始化的全局变量
  ULONG_PTR m_gdiplusToken;
  Gdiplus::Bitmap* m_pImage;
  Gdiplus::Rect m_progressRect;
  Gdiplus::Color m_progressColor;
  float progress_;
};

#endif // SPLASHSCREEN_H